package com.ynunicom.dc.dingdingcontractapp.configuration;

import com.ynunicom.dc.dingdingcontractapp.configuration.properties.AppInfoConfigProperties;
import com.ynunicom.dc.dingdingcontractapp.utils.AppInfoUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author: jinye.Bai
 * @date: 2020/5/26 11:37
 */
@EnableConfigurationProperties(AppInfoConfigProperties.class)
@Configuration
public class AppInfoConfig {

    @Autowired
    AppInfoConfigProperties appInfoConfigProperties;

    @Bean("appInfoUtil")
    public AppInfoUtil appInfoUtil(){
        return new AppInfoUtil(appInfoConfigProperties.getAPP_KEY(),appInfoConfigProperties.getAPP_SECRET());
    }
}
